<?php

/**
 * JingYao-backend
 *
 * @link     https://gitee.com/wang-zhihui-release/jingyao-backend
 * @apiDocument https://gitee.com/wang-zhihui-release/jingyao-backend/wikis/
 */

namespace App\Http\Controllers;

use App\Services\DataChartService;

class DataChartController extends Controller
{
    protected $dataChartService;

    public function __construct(DataChartService $dataChartService)
    {
        $this->dataChartService = $dataChartService;
    }

    public function getUserProfileCount()
    {
        $count = $this->dataChartService->getUserProfileCount();
        return renderSuccessJson([
            'count' => $count,
        ]);
    }

    public function getFlowUserCount()
    {
        $count = $this->dataChartService->getFlowUserCount();
        return renderSuccessJson([
            'count' => $count,
        ]);
    }

    public function getNotFlowUserCount()
    {
        $count = $this->dataChartService->getNotFlowUserCount();
        return renderSuccessJson([
            'count' => $count,
        ]);
    }

    public function getDayFlowUserDiff()
    {
        $res = $this->dataChartService->getDayFlowUserDiff();
        return renderSuccessJson($res);
    }

    public function getWorkRate()
    {
        $res = $this->dataChartService->getWorkRate();
        return renderSuccessJson($res);
    }

    public function getProvince()
    {
        $res = $this->dataChartService->getProvince();
        return renderSuccessJson($res);
    }

    public function getSexs()
    {
        $res = $this->dataChartService->getSexs();
        return renderSuccessJson($res);
    }

    public function getIdentifies()
    {
        $res = $this->dataChartService->identifies();
        return renderSuccessJson($res);
    }

    public function getIndustries()
    {
        $res = $this->dataChartService->industries();
        return renderSuccessJson($res);
    }

    public function getAges()
    {
        $res = $this->dataChartService->ages();
        return renderSuccessJson($res);
    }

    public function getAreas()
    {
        $res = $this->dataChartService->areas();
        return renderSuccessJson($res);
    }

    public function getEducation()
    {
        $res = $this->dataChartService->getEducation();
        return renderSuccessJson($res);
    }

    public function getPassCard()
    {
        $res = $this->dataChartService->getPassCard();
        return renderSuccessJson([
            'count' => $res,
        ]);
    }

    public function getMonthUsers()
    {
        $res = $this->dataChartService->getMonthUserCount();
        return renderSuccessJson($res);
    }

    public function getCompanyArea()
    {
        $res = $this->dataChartService->companies();
        return renderSuccessJson($res);
    }

    public function getVaccinations()
    {
        $res = $this->dataChartService->vaccinations();
        return renderSuccessJson($res);
    }
}
